<script>
import { mapState, mapMutations, mapGetters } from 'vuex'

export default {
  name: 'SecondPage',
  data() {
    return {}
  },
  computed: {
    ...mapState('TestModule', {
      name: state => {
        console.log('state', state)
        return state.name
      },
      age: state => state.age,
    }),
    ...mapGetters('TestModule', {
      userInfo: 'getter_user_info',
    }),
  },
  methods: {
    ...mapMutations('TestModule', ['set_person_info']),
  },
}
</script>

<template>
  <div>
    <h3>SecondPage</h3>
    <div>姓名:{{ name }}</div>
    <div>年龄:{{ age }}</div>
    <div>{{ userInfo }}</div>
  </div>
</template>

<style lang="scss" scoped></style>
